<?php
require_once("taskpointView.php");
require_once(CORE_DIR.'taskpointModel.php');

class updateAction extends authAction{

	function __construct(){
		$this->view = new taskpointView();
	}

	public function run($get, $post, $viewtype) {
		parent::run($get,$post,$viewtype);
		
		$tpModel = new taskpointModel();	 	
		
		if (isset($get["pointid"]) && isset($get["taskid"]) && isset($get["point"])){
			$pointTypeID = $get["pointid"];
			$taskID = $get["taskid"];
			$point = $get["point"];
			
			$status = 0;
			if ($tpModel->updateTaskPoint($pointTypeID, $taskID, $point)){
				$status = 1;
			}
			
			$this->view->setProperty("status", $status);
			$this->view->setProperty("id", $pointTypeID.":".$taskID);
			$this->view->showUpdateTaskPoint();
		}
		else{
			$this->view->showBadCmd();
		}	
			
	}
}
?>